<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">

    <h:form>
        <p:outputLabel value="* Rubrici obligatorii pentru completare" style="font-size: 11px;"/>

        <div style="border-bottom: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD;">
            <p:watermark value="Introduceti prenumele" for="firstName"/>
            <h:panelGrid styleClass="input-panel" columns="4" columnClasses="column-1, column-2" rowClasses="row-style">
                <p:outputLabel value="NPP:" styleClass="table-label"/>
                <p:inplace>
                    <p:inputText id="firstName" value="#{folderBean.selectedFolder.firstName}" required="true"
                                 label="text"/>
                </p:inplace>

                <p:outputLabel value="Domiciliul:" styleClass="table-label"/>
                <p:inplace>
                    <p:inputText value="#{folderBean.selectedFolder.residenceVisa}" required="true"
                                 label="text"/>
                </p:inplace>

                <h:outputText/>
                <p:inplace>
                    <p:inputText value="#{folderBean.selectedFolder.lastName}" required="true" label="text"/>
                </p:inplace>

                <p:outputLabel value="Nationalitatea:" styleClass="table-label"/>
                <p:inplace>
                    <p:selectOneMenu id="nationality" value="#{folderBean.selectedFolder.nationality}"
                                     converter="#{selectComponentConverter}" required="true" label="text">
                        <f:selectItem itemLabel="Selectati nationalitatea"/>
                        <f:selectItems value="#{applicationStateBean.nationalities}" var="n" itemLabel="#{n.name}"
                                       itemValue="#{n.id}"/>
                    </p:selectOneMenu>
                </p:inplace>

                <h:outputText/>
                <p:inplace>
                    <p:inputText value="#{folderBean.selectedFolder.patronymic}" required="true" label="text"/>
                </p:inplace>

                <p:outputLabel value="Cod IDNP:" styleClass="table-label"/>
                <p:inplace>
                    <p:inputText value="#{folderBean.selectedFolder.IDNP}" required="true"
                                 label="text"/>
                </p:inplace>

                <p:outputLabel value="Data nasterii:" styleClass="table-label"/>
                <p:inplace>
                    <p:calendar value="#{folderBean.selectedFolder.birthDate}" showOn="button" required="true"
                                label="text">
                        <f:convertDateTime pattern="dd/MM/yyyy"/>
                    </p:calendar>
                </p:inplace>

                <p:outputLabel value="Starea familiala:" styleClass="table-label"/>
                <p:inplace>
                    <p:selectOneMenu id="family-status" value="#{folderBean.selectedFolder.familyStatus}"
                                     converter="#{selectComponentConverter}" required="true" label="text">
                        <f:selectItem itemLabel="Selectati starea familiala"/>
                        <f:selectItems value="#{applicationStateBean.familyStatuses}" var="fs" itemLabel="#{fs.name}"
                                       itemValue="#{fs.id}"/>
                    </p:selectOneMenu>
                </p:inplace>

                <p:outputLabel value="Sex:" styleClass="table-label"/>
                <p:inplace>
                    <p:selectOneRadio id="sex" value="#{folderBean.selectedFolder.sex}"
                                      converter="#{selectComponentConverter}" label="text">
                        <f:selectItem itemLabel="Male" itemValue="0"/>
                        <f:selectItem itemLabel="Female" itemValue="1"/>
                    </p:selectOneRadio>
                </p:inplace>

                <p:outputLabel value="Date de contact:" styleClass="table-label"/>
                <p:inplace>
                    <p:inputText value="#{folderBean.selectedFolder.contactData}" required="true"
                                 label="text"/>
                </p:inplace>
            </h:panelGrid>
        </div>

        <div style="/*display: table-cell;*/text-align: right; padding: 5px 20px;">
            <ui:remove>
                <!--<p:commandLink actionListener="#{folderBean.saveFolderData()}" update="@form">
                    <p:graphicImage value="../../resources/img/icons/save-icon-1.png" styleClass="save-icon" width="20" height="20" />
                </p:commandLink>
                <p:commandLink update="@form" process="@this" oncomplete="defaultValueForInPlaceComponents()">
                    <p:graphicImage value="../../resources/img/icons/cancel-icon-1.png" styleClass="cancel-icon" width="20" height="20" />
                </p:commandLink>-->
            </ui:remove>

            <p:commandButton icon="ui-icon-disk" actionListener="#{folderBean.savePersonalInfo()}" update="@form"/>
            <p:commandButton update="@form" icon="ui-icon-close" process="@this"
                             oncomplete="defaultValueForInPlaceComponents()" style="text-decoration: underline;"/>
        </div>
    </h:form>

</ui:composition>